<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>1.何为数据劫持</title>
  </head>
  <body>
    <script type="text/javascript" >
      let _data = {}

      Object.defineProperty(_data,'n',{
        get:function xiangyingshiGetter(){
          return 1
        },
        set:function xiangyingshiSetter(value){
          console.log(`n修改了，修改后的值是${value}，我要去更新页面了`)
        }
      })


    </script>
  </body>
</html>